local Image = require 'widgets/image'
local UIAnim = require 'widgets/uianim'

AddClassPostConstruct('screens/playerhud', function(self)
    -- self.filterimg = self:AddChild(Image('images/fx_0001.xml', 'fx_0001.tex','fx_0001.tex'))
    -- local maxw,maxh = TheSim:GetScreenSize()	
    -- self.filterimg:SetVAnchor(ANCHOR_MIDDLE)
    -- self.filterimg:SetHAnchor(ANCHOR_MIDDLE)
    -- self.filterimg:SetSize(maxw,maxh)
    -- self.filterimg:MoveToBack() -- 一定要置底,否则会遮挡控制HUD
    -- self.filterimg:SetClickable(false) -- 一定要设置不可点击,否则会点击不了地面
    -- self.filterimg:Hide()
    self.inst.uitask = self.inst:DoTaskInTime(1, function()

        self.filter_uianim = self:AddChild(UIAnim())
        self.filter_uianim:SetVAnchor(ANCHOR_MIDDLE)
        self.filter_uianim:SetHAnchor(ANCHOR_MIDDLE)
        local maxw, maxh = TheSim:GetScreenSize()
        local scalew, scaleh = maxw / 64, maxh / 64
        self.filter_uianim:SetScale(scalew * 1.3, scaleh * 1.3)
        self.filter_uianim:MoveToBack() -- 一定要置底,否则会遮挡控制HUD
        self.filter_uianim:SetClickable(false) -- 一定要设置不可点击,否则会点击不了地面

        self.animstate = self.filter_uianim:GetAnimState()
        self.animstate:SetBuild('obro')
        self.animstate:SetBank('obro')
        self.animstate:PlayAnimation('anim', true) -- 设置动画循环
        self.animstate:AnimateWhilePaused(false) -- 暂停时停止动画

        self.filter_uianim:Hide()

    end)
end)


